package com.example.websocketserver.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.security.Principal;

/**
 * websocket携带的用户信息，作为内置Principal继承对象
 *
 * @author liulei
 * @version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HomeHubWebsocketPrincipal implements Principal {

    /**
     * 用户唯一标识，也作为点对点消息的入口
     */
    private String userId;

    @Override
    public String getName() {
        return this.userId;
    }
}
